﻿package mortal.game.view.mount.data
{
    import Message.DB.Tables.*;
    import Message.Game.*;
    import mortal.game.cache.*;
    import mortal.game.resource.tableConfig.*;

    public class MountCardData extends Object
    {
        private var _sMountCard:SMountCard;
        private var _tMountCard:TMountCardTarget;

        public function MountCardData(param1)
        {
            if (param1 is SMountCard)
            {
                this.sMountCard = param1;
            }
            else if (param1 is String)
            {
                this.tMountCard = MountConfig.instance.getMountTargetByIdAndLevel(param1);
            }
            return;
        }// end function

        public function set sMountCard(param1:SMountCard) : void
        {
            this._sMountCard = param1;
            this._tMountCard = MountConfig.instance.getMountTargetByIdAndLevel(param1.code + "_" + param1.level);
            return;
        }// end function

        public function get sMountCard() : SMountCard
        {
            return this._sMountCard;
        }// end function

        public function set tMountCard(param1:TMountCardTarget) : void
        {
            this._tMountCard = param1;
            return;
        }// end function

        public function get tMountCard() : TMountCardTarget
        {
            return this._tMountCard;
        }// end function

        public function get isHasCard() : Boolean
        {
            return this._sMountCard != null;
        }// end function

        public function get isCanActive() : Boolean
        {
            return this._sMountCard == null && this.tMountCard.cardId <= Cache.instance.mount.mountData.sPublicMount.code;
        }// end function

    }
}
